package com.lb.shopguide.entity.goods;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.List;

/**
 * Created by kang on 2017/6/1.
 */

public class GoodsDetailBean implements Serializable, Parcelable {
    /**
     * "returnCode": "0",
     * "message": "ok",
     * "returnContent": {
     * "distributeMode": "仅自提",
     * "productDetailHtml": "",
     * "productSkuList": [
     * ],
     * "productCode": "f931d6e626a74ee6b52641879ab7f362",
     * "typeName": "美妆日化",
     * "id": 1,
     * "productPicUrl": "http://static.storeer.com/wlwb/product/a4552a97-ac73-4033-9ae1-e12b8e891b35_580x580.jpeg",
     * "priceRange": "￥0.01-198.00",
     * "productPicList": [
     * <p>
     * ],
     * "productName": "哆啦A梦儿童滋养洗发沐浴露(2合1) 500ml",
     * "typeCode": "003",
     * "storeCode": "a2ccd2e79c1f44ada062dd8f0d2329bb"
     * }
     */
    private String productCode;
    private int id;
    private String productPicUrl;
    private String productName;
    private String priceRange;
    private int distributeMode;
    private String productDetailHtml;
    private List<SkuBean> productSkuList;
    private String typeName;
    private String typeCode;
    private String storeCode;

    private List<GoodsPicBean> productPicList;
    //本地维护
    private SkuBean curSkuBean;
    private int sum;//购买的数目
    private boolean checked;
    private boolean notValid;//true则该商品非法


    protected GoodsDetailBean(Parcel in) {
        productCode = in.readString();
        id = in.readInt();
        productPicUrl = in.readString();
        productName = in.readString();
        priceRange = in.readString();
        distributeMode = in.readInt();
        productDetailHtml = in.readString();
        typeName = in.readString();
        typeCode = in.readString();
        storeCode = in.readString();
        sum = in.readInt();
        checked = in.readByte() != 0;
        notValid = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(productCode);
        dest.writeInt(id);
        dest.writeString(productPicUrl);
        dest.writeString(productName);
        dest.writeString(priceRange);
        dest.writeInt(distributeMode);
        dest.writeString(productDetailHtml);
        dest.writeString(typeName);
        dest.writeString(typeCode);
        dest.writeString(storeCode);
        dest.writeInt(sum);
        dest.writeByte((byte) (checked ? 1 : 0));
        dest.writeByte((byte) (notValid ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<GoodsDetailBean> CREATOR = new Creator<GoodsDetailBean>() {
        @Override
        public GoodsDetailBean createFromParcel(Parcel in) {
            return new GoodsDetailBean(in);
        }

        @Override
        public GoodsDetailBean[] newArray(int size) {
            return new GoodsDetailBean[size];
        }
    };

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProductPicUrl() {
        return productPicUrl;
    }

    public void setProductPicUrl(String productPicUrl) {
        this.productPicUrl = productPicUrl;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getPriceRange() {
        return priceRange;
    }

    public void setPriceRange(String priceRange) {
        this.priceRange = priceRange;
    }

    public int getDistributeMode() {
        return distributeMode;
    }

    public void setDistributeMode(int distributeMode) {
        this.distributeMode = distributeMode;
    }

    public String getProductDetailHtml() {
        return productDetailHtml;
    }

    public void setProductDetailHtml(String productDetailHtml) {
        this.productDetailHtml = productDetailHtml;
    }

    public List<SkuBean> getProductSkuList() {
        return productSkuList;
    }

    public void setProductSkuList(List<SkuBean> productSkuList) {
        this.productSkuList = productSkuList;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }

    public String getStoreCode() {
        return storeCode;
    }

    public void setStoreCode(String storeCode) {
        this.storeCode = storeCode;
    }

    public List<GoodsPicBean> getProductPicList() {
        return productPicList;
    }

    public void setProductPicList(List<GoodsPicBean> productPicList) {
        this.productPicList = productPicList;
    }

    public SkuBean getCurSkuBean() {
        return curSkuBean;
    }

    public void setCurSkuBean(SkuBean curSkuBean) {
        this.curSkuBean = curSkuBean;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public boolean isNotValid() {
        return notValid;
    }

    public void setNotValid(boolean notValid) {
        this.notValid = notValid;
    }
}
